<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .chart1 {
        width: 800px;
        height: 400px;
      }

      .chart2 {
        width: 800px;
        height: 400px;
      }
    </style>
  </head>
  <body>
    <div class="chart1"></div>
    <div class="chart2"></div>
    <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.3.3/echarts.min.js"></script>
    <script>
      const chart = echarts.init(document.querySelector('.chart1'));
      const option = {
        xAxis: {
          data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
        },
        yAxis: {},
        series: {
          type: 'line',
          data:  [5, 20, 36, 10, 10, 20]
        },

        title: {
          text: '折线图'
        }
      }
      chart.setOption(option)



      const chart2 = echarts.init(document.querySelector('.chart2'), 'dark', {renderer: 'svg'});
      const option2 = {
        xAxis: {
          data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
        },
        yAxis: {},
        series: {
          type: 'bar',
          data:  [5, 20, 36, 10, 10, 20]
        },
        title: {
          text: '柱状图'
        }
      }
      chart2.setOption(option2)
    </script>
  </body>
</html>
